<template>
<!-- 巡田弹窗 -->
  <div>
    <el-dialog
      :title="title || '详情'"
      :visible.sync="dialogVisible"
      @close="close"
    >
     <div v-show="state">状态：{{state}}</div>
      <el-form :model="form">
        <el-form-item label="巡田开始时间" :label-width="formLabelWidth">
          <el-date-picker
            v-model="form.startDate"
            type="date"
            placeholder="选择日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="巡田结束时间" :label-width="formLabelWidth">
          <el-date-picker
            v-model="form.endDate"
            type="date"
            placeholder="选择日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="工作内容" style="padding:0 20px">
          <el-input type="textarea" v-model="form.jobContent"></el-input>
        </el-form-item>
        <el-form-item label="备注" style="padding:0 20px">
          <el-input type="textarea" v-model="form.remarks"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="release()">发布</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "dialogs",
  props: ["title", "visible"],
  data() {
    return {
      state:false,//巡田状态
      formLabelWidth: "120px",
      form: {
        startDate: "", //开始时间
        endDate: "", //结束时间
        jobContent: "", //工作内容
        remarks: "" //备注
      }
    };
  },
  computed: {
    dialogVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        // 当visible改变的时候，触发父组件的 updateVisible方法，在该方法中更改传入子组件的 centerDialogVisible的值
        this.$emit("updateVisible", val);
      }
    }
  },

  methods: {
    //发布确认
    release() {
      this.$emit("release", form);
    },
    close() {
      this.$emit("close");
    }
  }
};
</script>

<style scoped>
/* .el-collapse-item__header {
  border: 1px solid #d9d9d9;
  background-color: rgb(93, 182, 82);
  padding-left: 20px;
} */
.head {
  height: 40px;
  background-color: rgb(59, 211, 123);
}
</style>
